<template>
<h1>Form 表单</h1>
  <h2>注册页面</h2>
  <el-form   style="width: 500px;margin: 0 auto" >
<el-form-item label="用户名">
 <el-input placeholder="请输入用户名" v-model="user.username"></el-input>
</el-form-item>
    <el-form-item label="密码">
      <el-input type="password" placeholder="请输入密码" v-model="user.password"></el-input>
    </el-form-item>
    <el-form-item  label="性别">
        <el-radio-group v-model="user.gender">
          <el-radio-button value="1" label="男"></el-radio-button>
          <el-radio-button value="0" label="女"></el-radio-button>
        </el-radio-group>
    </el-form-item>
    <el-form-item label="所在地" >
      <el-select v-model="user.city" placeholder="请选择你的城市" >
        <el-option value="bj" label="北京"></el-option>
        <el-option value="sh" label="上海"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item style="width: 700px;margin: 0 auto">
      是否为管理员<el-switch v-model="user.idAdmin" active-color="#13ce66" inactive-color="#ff4949" ></el-switch>
    </el-form-item>
    <rl-form-item>
      <el-button type="success" @click="show()">注册</el-button>
    </rl-form-item>
  </el-form>
</template>
<script setup>
import {ref} from "vue";
const user = ref({
  city:'',
  username:'',
  password:'',
  gender:'',
  idAdmin:''
})
const show = () =>{
  console.log(user.value)
}

</script>

<style scoped>

</style>